package com.leetcode.demo;

/**
 * @Author: WuPeng
 * @Date: 2022/3/18 5:11 下午
 */
public class To100 {

    public static void main(String[] args) {

        int count = 0;

        for (int i = 0; i <= 100; i++) {
            int total = i;
            if (total == 100){
                System.out.println("组成-->"+i+"个1");
                count++;
                break;
            }
            int j_len = (100 - total) / 2;
            for (int j = 0; j <= j_len; j++) {
                total = i + 2 * j;
                if (total == 100){
                    System.out.println("组成-->"+i+"个1" + "，"+j+"个2");
                    count++;
                    break;
                }
                int k_len = (100 - total) / 5;
                for (int k = 0; k <= k_len; k++) {
                    total = i + 2 * j + 5 * k;
                    if (total == 100){
                        System.out.println("组成-->"+i+"个1" + "，"+j+"个2，"+k+"个5");
                        count++;
                        break;
                    }
                }
            }
        }
        System.out.println(count);
    }

}
